package com.asa.physics;

import com.asa.physics.bean.XYZT;

public class FuncMinShi {

	/**
	 * 闵式空间中c光速是1
	 * 这里的v是一定要小于1的，不然就超光速了
	 * @param xyzt
	 * @return
	 */
	public static XYZT to(XYZT xyzt) {
		
		
		 
		XYZT xtzt2 = new XYZT();
		
		long x = xyzt.x;
		long y = xyzt.y;
		long z = xyzt.z;
		long xt = xyzt.xt;
		long yt = xyzt.yt;
		long zt = xyzt.zt;
		
		long vx = xyzt.vx;
		long vy = xyzt.vy;
		long vz = xyzt.vz;

		long xoumiga = tooumiga(vx);
		long youmiga = tooumiga(vy);
		long zoumiga = tooumiga(vz);

		
		
		xtzt2.x = toDistance(x, xt, vx,xoumiga);
		xtzt2.y = toDistance(y, yt, vy,youmiga);
		xtzt2.z = toDistance(z, zt, vz,zoumiga);

		xtzt2.xt = toTime(x, xt, vx,xoumiga);
		xtzt2.yt = toTime(y, yt, vy,youmiga);
		xtzt2.zt = toTime(z, zt, vz,zoumiga);
		
		
		return xtzt2;
		
	}
	
	
	
	
	public static long toDistance(long x,long t,long v,long oumiga) {
		
		long x2 = oumiga*(x-v*t);

		return x2;
		
	}
	
	
	
	public static long toTime(long x,long t,long v,long oumiga) {
		
		long t2 = oumiga*(t-v*x);;

		return t2;
		
	}
	
	public static long tooumiga(long v) {
		
		
		long result = (long) (1/Math.sqrt(1-Math.pow(v/1, 2)));
		
		
		return result;
	}

	
	
	
	
	
	
	
	
}
